<template>
	<view class="meCom">
		<u-navbar :is-back="false" title="我的" :background="{ background: '#a0cfff' }" title-color="#FFFFFF"></u-navbar>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30" @click="meClick('../me/userMessage')">
			<view class="u-m-r-10">
				<u-avatar :src="user.userUrl" size="140"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">{{user.username}}</view>
				<view class="u-font-14 u-tips-color">邮箱:{{user.email}}</view>
			</view>
			<view class="u-m-l-10 u-p-10">
				<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
			</view>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="car" title="发布商品" @click="meClick('../me/publishShop')"></u-cell-item>
				<u-cell-item icon="red-packet" title="购买商品订单" @click="meClick('../me/order')"></u-cell-item>
				<u-cell-item icon="red-packet" title="出售商品订单" @click="meClick('../me/shopOrder')"></u-cell-item>
				<u-cell-item icon="calendar" title="我的帖子" @click="meClick('../me/invnList')"></u-cell-item>
				<u-cell-item icon="bell" title="我的求购商品" @click="meClick('../me/invShopme')"></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="kefu-ermai" title="意见反馈" @click="meClick('../me/feedback')"></u-cell-item>
				<u-cell-item icon="zhuanfa" title="退出登陆" @click="logout()"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pic:'https://uviewui.com/common/logo.png',
				show:true,
				user: {}
			}
		},
		created() {
			this.getUser()
		},
		methods: {
			getUser(){
				let that = this
				let user = uni.getStorageSync("user")
				that.user = user
				// that.
			},
			logout(){
				uni.removeStorage("user")
				uni.reLaunch({
					url: '../user/login'
				})
			},
			meClick(item){
				uni.navigateTo({
					url: item
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
page{
	background-color: #ededed;
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
}
</style>
